import React ,{lazy}from 'react'
import { Routes,Route } from 'react-router'
import Home from '../pages/Home'
const HomeDetail =lazy(()=>import('../pages/HomeDetail'))
const Cities =lazy(()=>import('../pages/Cities'))
const Order = lazy(()=>import('../pages/Order'))
const Find =lazy(()=>import('../pages/Find'))
const Mine =lazy(()=>import('../pages/Mine'))
const HomeOrder =lazy(()=>import('../pages/HomeDetail/HomeOrder'))
const HomeComment =lazy(()=>import('../pages/HomeDetail/HomeComment'))
const HomeBusiness =lazy(()=>import('../pages/HomeDetail/HomeBusiness'))

export default function RoutesConfig() {
  return (
    <>
      <Routes>
        <Route  path='/' element={<Home/>}/>
        <Route  path='/home' element={<Home/>}/>
        <Route  path='/order' element={<Order/>}/>
        <Route  path='/find' element={<Find/>}/>
        <Route  path='/mine' element={<Mine/>}/>
        <Route  path='/cities' element={<Cities/>}/>
        <Route  path='/homedetail/:id' element={<HomeDetail/>}>
            <Route path='/homedetail/:id/order' element={<HomeOrder/>} />
            <Route path='/homedetail/:id/comment' element={<HomeComment/>} />
            <Route path='/homedetail/:id/business' element={<HomeBusiness/>} />
        </Route>
      </Routes>
    </>
  )
}
